<%@ include file="database_ini.jsp"%>

<%!
String blanknull(String s) {
  return (s == null) ? "" : s;
}
%>
<CENTER>
<a href="index.jsp"><font size="3">Home</font></a>
<p>
<form method="post" action="update.jsp">
<table border="1">
<tr><th>listname</th><th>code</th><th>description</th><th>short</th><th>long_value</th><th>notes</th></tr>
<%
String serialkey=request.getParameter("serialkey");
String listname ="";
//int no=Integer.parseInt(serialkey);
int sumcount=0;

String sql = "select * from codelkup where serialkey =?";

pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serialkey);

ResultSet rs = pstmt.executeQuery();

while(rs.next()){
listname=rs.getString("listname");
%>
<tr>
<td><input type="text" name="listname" size="10" readonly="readonly" value="<%=blanknull(rs.getString("listname"))%>" ></td>
<td><input type="text" name="code" maxlength="10" size="5" value="<%=blanknull(rs.getString("code"))%>"></td>
<td><input type="text" name="description" maxlength="250" size="10" value="<%=blanknull(rs.getString("description"))%>"></td>
<td><input type="text" name="short" maxlength="30" size="20" value="<%=blanknull(rs.getString("short"))%>"></td>
<td><input type="text" name="long_value" maxlength="250" size="20" value="<%=blanknull(rs.getString("long_value"))%>"></td>
<td><input type="text" name="notes" maxlength="2000" size="20" value="<%=blanknull(rs.getString("notes"))%>"></td>
<td><input type="hidden" name="serialkey" value="<%=blanknull(rs.getString("serialkey"))%>"></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Update" style="background-color:#49743D;font-weight:bold;color:#ffffff;"></td>
<td></td>
<td><a href="application.jsp?listname=<%=listname%>" ><font size="3">Back</font></a></td>
<td></td>
<td></td>
<td></td>
</tr>
<%
}
%>
</table>
</form>
</CENTER>